package cs8;

public class Dog3 {
	public String name;
	public String owner;
	int age;
	
	
	public Dog3(String name,String owner,int age){
		this.name =name;
		this.owner=owner;
		this.age=age;
		
	}
	public void print(){
		System.out.println(owner+":"+name+":"+age);
	}

	public int hashCode(){
		String s = name+owner;
		return s.hashCode();
	}
	
	public boolean equals(Object anotherObject){
		if(!(anotherObject instanceof Dog2)){
			return false;
		}
		Dog2 anotherDog = (Dog2)anotherObject;
		return name.equals(anotherDog.name)&&owner.equals(anotherDog.owner);
	}
	
}


